package ccpv;

import java.util.ArrayList;


public class Data<T> {
	private int population = 0;
	
	private ArrayList<T> values = new ArrayList<T>();
    	
	public Data (int m_population, ArrayList<T> m_values) {
		this.setPopulation(m_population);
		for (T v : m_values) {
			this.values.add(v);
		}
	}
	
	public void addValue(T value2) {
		values.add(value2);
	}

	public int getNumValues() {
		return values.size();
	}
	


	/**
	 * @param value the value to set
	 */
	public void setValues(ArrayList<T> values2) {
		this.values.clear();
		for(T val: values2) {
			this.values.add(val);
		}
	}

	/**
	 * @return the value
	 */
	public ArrayList<T> getValues() {
		return values;
	}
	
	public T getValueAt(int i) {
		return values.get(i);
	}
	
	public String toString() {
		String st = "(";
		st = st + " ";
		for (T value: values) {
		  st = st + ", " + value.toString();	
		}
		st = st + ")";
		return st;
	}

	/**
	 * @param population the population to set
	 */
	public void setPopulation(int population) {
		this.population = population;
	}

	/**
	 * @return the population
	 */
	public int getPopulation() {
		return population;
	}


}
